using System;
using System.IO;
using System.Configuration;
using System.Web;
using Oplaco.Core.BusinessLogicLayer;


namespace Oplaco.Web.UI
{
    /// <summary>
    /// Handles mapping between enum and output strings
    /// </summary>
    public sealed class OutputFormatting
    {
        private OutputFormatting()
        {
        }

        /// <summary>
        /// gets status of ad based on object input
        /// </summary>
        /// <param name="adStatus"></param>
        /// <returns></returns>
        public static string AdStatusToString(object adStatus)
        {
            return AdStatusToString((AdStatus)(int)adStatus);
        }

        /// <summary>
        /// get string from adstatus enum
        /// </summary>
        /// <param name="adStatus"></param>
        /// <returns></returns>
        public static string AdStatusToString(AdStatus adStatus)
        {
            switch (adStatus)
            {
                case AdStatus.Activated:
                    return "Active";
                case AdStatus.ActivationPending:
                    return "Activation Pending";
                case AdStatus.Inactive:
                    return "Inactive / Expired";
                case AdStatus.Deleted:
                    return "Deleted";
                default:
                    return "(other)";
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="adType"></param>
        /// <returns></returns>
        public static string AdTypeToString(object adType)
        {
            return AdTypeToString((AdType)(int)adType);
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="adType"></param>
        /// <returns></returns>
        public static string AdTypeToString(AdType adType)
        {
            switch (adType)
            {
                case AdType.ForSale:
                    return "For Sale";
                case AdType.Wanted:
                    return "Wanted";
                default:
                    return "(other)";
            }
        }

    }
}